package com.fa4j.common.base.exception;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 请求相关错误
 */
@Getter
@AllArgsConstructor
public enum CommonRequestError implements RequestErrorType {

    BAD_REQUEST(400, "请求错误"),

    EXISTED(400, "{0}已存在"),
    IN_USED(400, "{0}已被占用"),
    NOT_EMPTY(400, "{0}不能为空"),
    PARAM_ERROR(400, "{0}错误"),
    PARAM_INVALID(400, "{0}无效"),
    PARAM_TYPE_ERROR(400, "{0}类型错误"),
    PARAM_MISS(400, "缺少参数{0}"),

    UNAUTHORIZED(401, "账号未登录"),
    FORBIDDEN(403, "无权限"),
    NOT_FOUND(404, "{0}未找到"),
    LOCKED(423, "请求失败，请稍后再试"),
    TOO_MANY_REQUESTS(429, "请求人数过多，请稍后再试"),
    ;

    private final Integer errCode;
    private final String errMsg;

}
